

<!--解决vuex页面刷新数据丢失问题？-->
<!--办法一：将vuex中的数据直接保存到浏览器缓存中（sessionStorage、localStorage、cookie）-->
<!--办法二：在页面刷新的时候再次请求远程数据，使之动态更新vuex数据-->
<!--办法三：在父页面向后台请求远程数据，并且在页面刷新前将vuex的数据先保存至sessionStorage（以防请求数据量过大页面加载时拿不到返回的数据）-->
<script>
export default inputImel;
import inputImel from "./inputImel";
</script>
<!--src 引用css样式-->
<style src="./index.css" lang="css"></style>

<template>
  <div class="brand-wrapper" align="center">
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path:'/putStorageDetails/'+this.$route.params.id }">销售出库</el-breadcrumb-item>
      <el-breadcrumb-item>销售出库订单查看</el-breadcrumb-item>
    </el-breadcrumb>
    <el-divider></el-divider>
    <PutstorageInfo :put-stotage-info="putStotageInfo"></PutstorageInfo>
    <el-divider></el-divider>
    <el-descriptions>
      <el-descriptions-item label="商品编号">{{goods.productCode}}</el-descriptions-item>
      <el-descriptions-item label="商品名称">{{goods.productName}}</el-descriptions-item>
      <el-descriptions-item label="商品颜色">{{goods.productColor}}</el-descriptions-item>
    </el-descriptions>
    <el-divider></el-divider>
    <el-descriptions>
      <el-descriptions-item label="采购数量">
        <el-tag size="small">{{goods.purchaseNum}}</el-tag>
      </el-descriptions-item>
      <el-descriptions-item label="入库类别">
        <template>
          <el-select v-model="purchaseType" placeholder="请选择">
            <el-option
                v-for="(key,id) in options.purchaseType"
                :key="id"
                :label="key"
                :value="id">
            </el-option>
          </el-select>
        </template>
      </el-descriptions-item>
    </el-descriptions>
    <el-divider></el-divider>
    商品串号录入:  <el-tag>商品串号数量:{{imelListLenth}}</el-tag>
    <el-divider></el-divider>
    <el-input
        type="textarea"
        :rows="5"
        placeholder="请输入内容"
        v-model="imelList"
        @input="limitationLength()"
        style="width: 50%"
        :disabled="disableNoteStr">
    </el-input>
    <br>
    <br>
    <el-upload
        class="upload-demo"
        action="http://localhost:8088/putStorage/upload/"
        :on-success="handleAvatarSuccess"
        multiple>
      <el-button size="small" type="primary" v-if="goods.intoState==0">点击上传</el-button>
    </el-upload>

<!--    <el-button>导入商品串码</el-button>-->
    <el-divider></el-divider>
    <a>导入串号模板下载:</a>
    <el-link type="primary" href="http://localhost:8088/putStorage/download">串号模板.xls</el-link>
    <el-divider></el-divider>
    <a>备注:  </a>
    <el-input
        type="textarea"
        :rows="2"
        placeholder="请输入内容"
        v-model="note"
        style="width: 50%"
        >
    </el-input>


    <el-divider><i class="el-icon-caret-bottom"></i></el-divider>
    <div v-if="goods.intoState==0 ||goods.putStorageNum<goods.purchaseNum">
      <el-button type="info" @click="submitImelList(false)">暂存</el-button>
      <el-button type="primary" @click="submitImelList(true)">录入完毕</el-button>
      <el-button type="primary" @click="putClose">返回</el-button>
    </div>

    <div v-if="goods.intoState==1 &&goods.putStorageNum===goods.purchaseNum">
      <el-button type="primary" @click="putClose">返回</el-button>
    </div>


  </div>
</template>
